package cn.middle.edge.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.middle.common.base.mapper.BaseMapper;
import com.middle.common.base.service.impl.BaseServiceImpl;
import com.middle.common.result.Page;

import cn.middle.edge.entity.Event;
import cn.middle.edge.mapper.EventMapper;
import cn.middle.edge.service.EventService;

@Service
public class EventServiceImpl extends BaseServiceImpl<Event> implements EventService {

	@Autowired
	public EventMapper mapper;
	@Override
	public BaseMapper<Event> getDao() {
		return mapper;
	}
	@Override
	public Page<Event> listConditions(int page, int pageSize, String serviceId, Integer eventCode, String keyword) {
		PageHelper.startPage(page,pageSize);
		List<Event> events = mapper.listConditions(serviceId, eventCode, keyword);
		return new Page<>(new PageInfo<>(events));
	}



}
